package cn.kgc.ebookvue02.controller;

import cn.kgc.ebookvue02.pojo.Category;
import cn.kgc.ebookvue02.pojo.ResultEntity;
import cn.kgc.ebookvue02.service.CategoryService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author shkstart
 * @create 2020-05-19 22:28
 */
@RestController
public class CategoryController {

    @Resource
    CategoryService categoryService;

    @RequestMapping("/getCategoryList")
    public ResultEntity<List<Category>> getCategoryList(){
        List<Category> categories = categoryService.selectAllCategory();
        return  ResultEntity.successWithoutData(categories);
    }

}
